#include <iostream>
using namespace std;
const int N = 1e6 + 10;

int e[N] , ne[N] , idx;


void init(){idx = 1;ne[0] = -1;}

void to_insert(int k,int x)
{
    e[idx] = x; 
    ne[idx] = ne[k];
    ne[k] = idx;
    ++idx;
}
void push_front(int x)
{
    to_insert(0,x);
}
void remove(int k)
{
    //删除第k个结点后面的结点
    ne[k] = ne[ne[k]];
}
void Print()
{
    int i = ne[0];
    while(i != -1)
    {
        std::cout << i << " ";
        i = ne[i];
    }
    std::cout << std::endl;
}

int main()
{
    init();
    push_front(1);
    push_front(2);
    push_front(3);
    push_front(4);
    to_insert(1,5);
    Print();
    return 0;
}